package com.phpxiu.app.adapter.holder;

import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.phpxiu.app.kkylive.R;
import com.phpxiu.app.view.custom.FrescoImageView;

/**
 * Created by 吴金洲 on 2016/8/12
 */
public class RoomManagerViewHolder2 {
    private String uid;
    private int position;
    public FrescoImageView headView;
    public TextView nickView;
    public ImageView sexView;
    public FrescoImageView lv;
    public TextView introView;
    public View divider;
    public RoomManagerViewHolder2(View itemView) {
        headView=(FrescoImageView)itemView.findViewById(R.id.admin_head_view);
        nickView=(TextView)itemView.findViewById(R.id.admin_nick);
        sexView=(ImageView)itemView.findViewById(R.id.user_sex_icon_view);
        lv=(FrescoImageView)itemView.findViewById(R.id.user_lvl_icon_view);
        introView=(TextView)itemView.findViewById(R.id.intro_view);
        divider=itemView.findViewById(R.id.item_divider);
    }

    public void setIntroViewText(String text){
        if(introView==null){
            return;
        }
        introView.setText(text);
        if(text==null||"".equals(text)){
            if(introView.getVisibility()==View.VISIBLE){
                introView.setVisibility(View.GONE);
            }
        }else{
            if(introView.getVisibility()!=View.VISIBLE){
                introView.setVisibility(View.VISIBLE);
            }
        }
    }

    public void showDivider(){
        if(divider.getVisibility()!=View.VISIBLE){
            divider.setVisibility(View.VISIBLE);
        }
    }

    public void hideDivider(){
        if(divider.getVisibility()==View.VISIBLE){
            divider.setVisibility(View.INVISIBLE);
        }
    }
    public String getUid() {
        return uid;
    }

    public void setUid(String uid) {
        this.uid = uid;
    }

    public int getPosition() {
        return position;
    }

    public void setPosition(int position) {
        this.position = position;
    }
}
